import {httpGet, httpPost, httpPut} from '@frontend/vue-common'
import {getCurrentGlobalProperties} from "@frontend/vue-common/src/app";

export const listCounterpartyContactAPI = (pageNum, pageSize, sortField, sortOrder, filter) => {
    return httpGet("/v1/soms/counterpartyContact", {
        pageNum: pageNum,
        pageSize: pageSize,
        sortField: sortField,
        sortOrder: sortOrder,
        counterpartyId: filter.counterpartyId,
		contactName: filter.contactName,
		contactPhone: filter.contactPhone,
		contactAddress: filter.contactAddress,
		provinceName: filter.provinceName,
		provinceCode: filter.provinceCode,
		cityName: filter.cityName,
		cityCode: filter.cityCode,
		areaName: filter.areaName,
		areaCode: filter.areaCode,
		
    })
}

export const addCounterpartyContactAPI = (data) => {
    return httpPut("/v1/soms/counterpartyContact", data)
}

export const getCounterpartyContactAPI = (data) => {
    return httpGet(`/v1/soms/counterpartyContact/${data.id}`, {})
}

export const editCounterpartyContactAPI = (data) => {
    return httpPost(`/v1/soms/counterpartyContact/${data.id}`, data)
}

export const deleteCounterpartyContactAPI = (ids) => {
    return httpPost(`/v1/soms/batchDeleteCounterpartyContact`, {
        ids: ids,
    })
}

